package cn.com.clearbus.service;

import cn.com.clearbus.dto.response.ResultBean;
import cn.com.clearbus.entity.CUser;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.web.bind.annotation.*;


public interface UserService {

     @GetMapping(value = "/user/discovery")
     Object discovery();

     @GetMapping(value = "/user/getUser")
     @Cacheable(value="user", key="#id") //user::0
     CUser getUser(@RequestParam(value = "id") String id);

    @PostMapping(value = "/user/deleteUser")
    @CacheEvict(value="user", key="#id", condition="#id!='1'")
    ResultBean deleteUser(@RequestParam(value = "id") String id);


    @PostMapping(value = "/user/updateUser")
    @CacheEvict(value="user", key="#id", condition="#id!='1'")
    ResultBean updateUser(@RequestParam(value = "id") String id);

    @PostMapping(value = "/user/saveUser")
    CUser saveUser(@RequestBody CUser cUser);

}
